﻿@model WebMobile.Models.Product
@{
    Layout = "~/Views/Shared/_LayoutForChild.cshtml";
}
@{
    ViewBag.Title = "Edit";
}

<h2>Edit</h2>


@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    
    <div class="form-horizontal">
        <h4>Product</h4>
        <hr />
        @Html.ValidationSummary(true)
        @Html.HiddenFor(model => model.ProductID)

        <div class="form-group">
            @Html.LabelFor(model => model.Name, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextBoxFor(model => model.Name, new { @class = "form-control"})
                @Html.ValidationMessageFor(model => model.Name)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.ProductNumber, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextBoxFor(model => model.ProductNumber, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.ProductNumber)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Color, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextBoxFor(model => model.Color, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.Color)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.StandardCost, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextBoxFor(model => model.StandardCost, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.StandardCost)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.ListPrice, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextBoxFor(model => model.ListPrice, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.ListPrice)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Size, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextBoxFor(model => model.Size, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.Size)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.Weight, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextBoxFor(model => model.Weight, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.Weight)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.ProductCategoryID, "ProductCategoryID", new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownList("ProductCategoryID", null, String.Empty, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.ProductCategoryID)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.ProductModelID, "ProductModelID", new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.DropDownList("ProductModelID",null, String.Empty, new { @class="form-control" })
                @Html.ValidationMessageFor(model => model.ProductModelID)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.SellStartDate, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextBoxFor(model => model.SellStartDate, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.SellStartDate)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.SellEndDate, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextBoxFor(model => model.SellEndDate, new { @class = "date-picker form-control" })
                @Html.ValidationMessageFor(model => model.SellEndDate)
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.DiscontinuedDate, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextBoxFor(model => model.DiscontinuedDate, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.DiscontinuedDate)
            </div>
        </div>

        <div class="form-group">
            @*@Html.LabelFor(model => model.ThumbNailPhoto, new { @class = "control-label col-md-2" })*@
            <div class="col-md-10">
                @Html.HiddenFor(model => model.ThumbNailPhoto)
                @Html.HiddenFor(model => model.rowguid)
                @*@Html.ValidationMessageFor(model => model.ThumbNailPhoto)*@
            </div>
        </div>

        <div class="form-group">
            @Html.LabelFor(model => model.ThumbnailPhotoFileName, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextBoxFor(model => model.ThumbnailPhotoFileName, new { @class = "form-control" })
                @Html.ValidationMessageFor(model => model.ThumbnailPhotoFileName)
            </div>
        </div>

        

        @*<div class="form-group">
            @Html.LabelFor(model => model.ModifiedDate, new { @class = "control-label col-md-2" })
            <div class="col-md-10">
                @Html.TextBoxFor(model => model.ModifiedDate, new { @class = "form-control date-picker" })
                @Html.ValidationMessageFor(model => model.ModifiedDate)
            </div>
        </div>*@

        <div class="form-group">
            <div class="col-md-offset-2 col-md-10">
                <input type="submit" value="Save" style="width:100px"  class="btn btn-info" />
            </div>
        </div>
    </div>
}



<div>
    @{
        
        //int productPrevID = (ViewBag.ProductPrev;
        if (ViewBag.ProductPrevID != null)
        {
           // @Html.ActionLink("Previous", "Edit", new { id = ViewBag.ProductPrevID });
            <input type="button" value="Previous" style="width:100px" class="btn btn-info" onclick="location.href='@Url.Action("Edit", new { id = ViewBag.ProductPrevID})'" />
        }
        else
        {
            <input type="button" value="Previous" style="width:100px" class="btn btn-info" disabled="disabled" />
        }
    }
     |
    @{
    //int productNextID = ViewBag.ProductNext;
    if (ViewBag.ProductNextID != null)
    {
        //@Html.ActionLink("Next","Edit", new { id = ViewBag.ProductNextID });
        <input type="button" value="Next" style="width:100px" class="btn btn-info" onclick="location.href='@Url.Action("Edit", new { id = ViewBag.ProductNextID})'" />
    }
    else
    {
             <input type="button" value="Next" style="width:100px" class="btn btn-info" disabled="disabled" />
        }
    }
    
</div>
<div>
    @*@Html.ActionLink("Back to List", "Index")*@
    <br />
    <input type="button" value="Back to List" style="width:100px" class="btn btn-info" onclick="location.href='@Url.Action("Index","Product")'" />
</div>
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
    
}
<script src="~/Scripts/datepicker.js" type="text/javascript"></script>
